<%@ page import="databeans.Customer"%>
<%@ page import="databeans.Employee"%>
<%@ page import="helper.Balance"%>
<%@ page import="helper.*"%>
<%@ page import="java.text.DecimalFormat"%>

<% DecimalFormat twoDForm = new DecimalFormat("#.##");%>
			<%
			Customer customer = (Customer)session.getAttribute("customer"); 
			Employee employee = (Employee)session.getAttribute("employee");
			String pg = (String)request.getAttribute("page");
			
			if(customer !=null) {
				String customerUsername = customer.getUsername();
				String customerFirstName = customer.getFirstName();
				String customerLastName = customer.getLastName();
			%>
			<div id="sidebar">
  				<ul>
                	<li><h3><a href="#" class="user"><%=customerFirstName + " " + customerLastName %></a></h3>
                        <ul>
                        	<li><a href="customerViewAccount.do" class="vcard <%if(pg =="view-acc") out.println("active"); %>">Account Info</a></li>
                            <li><a href="customerChangePassword.do" class="useredit <%if(pg =="change-pass") out.println("active"); %>">Change Password</a></li>
                            <li><a href="customerLogout.do" class="key">Logout</a></li>
                            <li><b class="money pad-left-20" >Total: </b>$<%= Formatter.prepCashToView(customer.getCash()) %></li>
                            <li><b class="money pad-left-20" >Available: </b>$<%= Formatter.prepCashToView(Balance.getCustomerAvailableCash(customer)) %></li>
                            
                        </ul>
                    </li>
                    <li style="height=20px;">&nbsp;</li>
                    <li><h3><a href="#" class="folder_table">Quick Links</a></h3>
          				<ul>
          					<li><a href="customerBuyFund.do" class="newspaper_add <%if(pg =="buy-fund") out.println("active"); %>">Buy Funds</a></li>
                            <li><a href="customerSellFund.do" class="newspaper_delete <%if(pg =="sell-fund") out.println("active"); %>">Sell Funds</a></li>
                            <li><a href="customerRequestCheck.do" class="coins <%if(pg =="req-check") out.println("active"); %>">Request Check</a></li>
                            <li><a href="customerViewTransactionHistory.do" class="invoices <%if(pg =="trans-hist") out.println("active"); %>">Transaction History</a></li>
                        </ul>
                    </li>
				</ul>       
          </div>
          <%}
			if(employee!=null) {
				String employeeUsername = employee.getUsername();
				String employeeFirstName = employee.getFirstName();
				String employeeLastName = employee.getLastName();
			%>

			<script type="text/javascript">
				$(document).ready(function() { 
			
			        //$("#popup").dialog({ bgiframe: true, autoOpen:false, modal: true, closeOnEscape: true, draggable:false, width:700, height:500, position: 'top', buttons: { "Close": function() { $(this).dialog('close'); } } });
					/*
					$('a#cust-search').click(function(e) { 
						e.preventDefault(); 
						$('#popup').dialog('open'); 
					});
					*/
				});
			</script>

			<div id="sidebar">
  				<ul>
  					<li><h3><a href="#" class="user"><%=employeeFirstName + " " + employeeLastName %></a></h3>
                        <ul>
                            <li><a href="employeeChangePassword.do" class="useredit <%if(pg =="change-pass"){ out.println("active"); } %>">Change Password</a></li>
                            <li><a href="employeeLogout.do" class="key">Logout</a></li>
                        </ul>
                    </li>
                    <li style="height=20px;">&nbsp;</li>
                	<li><h3><a href="#" class="house">Quick Links</a></h3>
                        <ul>
                        	<li><a href="employeeCustomerManager.do#create-button" class="useradd" id="add-cust">Add Customer</a></li>
                            <li><a href="employeeCreateEmployeeAccount.do" class="useradd" id="add-emp <%if(pg =="create-emp"){ out.println("active"); } %>">Add Employee</a></li>
                        </ul>
                    </li>
				</ul>       
          </div>
			
			<% }%>
          